package(default_visibility = ["//visibility:public"])

load(
    "@io_bazel_rules_go//go:def.bzl",
    "go_library",
    "go_test",
)

go_test(
    name = "go_default_test",
    srcs = [
        "client_test.go",
        "config_test.go",
        "metrics_test.go",
        "prowjob_test.go",
    ],
    embed = [":go_default_library"],
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/api/equality:go_default_library",
        "@io_k8s_apimachinery//pkg/util/diff:go_default_library",
        "@io_k8s_client_go//rest:go_default_library",
    ],
)

go_library(
    name = "go_default_library",
    srcs = [
        "client.go",
        "cluster.go",
        "config.go",
        "dry_run_client.go",
        "metrics.go",
        "prowjob.go",
        "ratelimiter.go",
    ],
    importpath = "k8s.io/test-infra/prow/kube",
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/client/clientset/versioned:go_default_library",
        "//prow/client/clientset/versioned/typed/prowjobs/v1:go_default_library",
        "@com_github_prometheus_client_golang//prometheus:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/api/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/types:go_default_library",
        "@io_k8s_apimachinery//pkg/watch:go_default_library",
        "@io_k8s_client_go//kubernetes:go_default_library",
        "@io_k8s_client_go//plugin/pkg/client/auth:go_default_library",
        "@io_k8s_client_go//rest:go_default_library",
        "@io_k8s_client_go//tools/clientcmd:go_default_library",
        "@io_k8s_client_go//util/workqueue:go_default_library",
        "@io_k8s_sigs_yaml//:go_default_library",
        "@org_golang_x_time//rate:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
)
